import { get, post } from '../index'

interface User {
  id: number
  name: string
  email: string
}

export const fetchUsers = () => {
  return get<User[]>('http://localhost:8080/api/getUsers')
}

export const createUser = (user: Omit<User, 'id'>) => {
  return post<User>(
    `http://localhost:8080/api/createUser?name=${user.name}&email=${user.email}`,
    {} // 空body
  );
}